package com.bawei.room.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.bawei.room.table.UserDaoEntity

/**
 * Author: Jason Zhang
 * Date: 2024/8/20
 * Desc: 用户信息操作类
 */

@Dao
interface UserInfoDao {

    @Insert
    suspend fun insert(vararg userInfo: UserDaoEntity)

    @Delete
    suspend fun delete(vararg userInfo: UserDaoEntity)

    @Update
    suspend fun update(vararg userInfo: UserDaoEntity)

    @Query("select * from user_table order by id")
    suspend fun queryAll(): List<UserDaoEntity>

    @Query("select * from user_table where id = :userId")
    suspend fun queryById(userId: Int): List<UserDaoEntity>

}